<template>
  <div id="nav">
    <button @click="update">切换button</button>
    <Child v-if="isShow" />

    <ToDo />
  </div>
</template>

<script lang="ts">
import Child from "@/views/Child.vue";
import ToDo from "@/views/ToDo.vue";
import { defineComponent,ref } from "vue";
import router from "@/router/index"
export default defineComponent({
  name: "App",
  components: {
    Child,ToDo
  },
  setup() {
    let isShow = ref(true);
    function update() {
      isShow.value = !isShow.value;
    }


    // 去往todolist页面
    function goToDoPage(){
      router.push('/ToDo')
    }

    return { isShow,update,goToDoPage };
  },
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
